package testdomainpubliccontest;

import conditionsAPI.ConditionDuplicatedException;
import conditionsAPI.SimpleDomainCondition;

public class CostCondition extends SimpleDomainCondition {

	private int value;
	
	public CostCondition(String id)  throws ConditionDuplicatedException {
		super(id);
	}
	
	public void setValue(int value) {
		this.value = value;
	}
	
	@Override
	public boolean checkConditionState(Object domainObject) {
		Requirement requirement = (Requirement) domainObject;
		if (requirement.getDescription().equals(Requirement.Description.COST) && (requirement.getValue() == this.value))
			return true;
		else 		
			return false;
	}
	
	protected boolean resetToInitialState(){
		return false;
	}
	
}
